import java.util.HashMap;


/*
 * This class is an integration class that represents the parent class for the system that is to be simulated
 * It provides concrete functions that the SplitSimSystem inherits
 */

public class SplitSimConcrete {
	public double poi;
	public double startPar;
	public double maxPar;
	HashMap<String,Double> state = new HashMap<String,Double>();
	
	//constructor
	public void SplitSimConcrete(){	
	}
	
	//this function syncs the realtime Simulation threshold level with the realtime simulation display
	public void syncLevel(){
		SplitSim.currentLevel = (int)((poi-this.startPar) / ((this.maxPar-this.startPar)/SplitSim.splitCount));
		/////System.out.println("poi:"+poi+" startPar:"+startPar+" maxPar:"+maxPar+" currentLevel:"+SplitSim.currentLevel);
		if (SplitSim.currentLevel<0)
			SplitSim.currentLevel=0;
		SplitSim.poi=poi;
		SplitSim.animateThreshold();
	}
	
	//this function retrieves the start threshold of the system
	public double getStartPar(){
		return this.startPar;
	}
	
	//this function retrieves the max threshold of the system
	public double getMaxPar(){
		return this.maxPar;
	}
	
	//this function sets the start threshold of the system
	public void setStartPar(double parValue){
		this.startPar=parValue;
	}
	
	//this function sets the max threshold of the system
	public void setMaxPar(double parValue){
		this.maxPar=parValue;
	}
	
	//this function gets the current state of the system
	public HashMap<String,Double> getState(){
		if (state.isEmpty()){
			setState();
		}
		return state;
	}
	
	//this is a dummy function, it should be implemented by the system class 
	public void setState(){
		
	}
	
}
